package com.ytjj.qmyx.admin.eunm;

import lombok.Getter;

@Getter
public enum BannerTypeEnums {

    H5("H5", "H5"),
    APP("app", "APP"),
    SECKILL("SECKILL", "秒杀"),
    NEW_USER("NEW_USER", "新人专享"),
    OLD_FOR_NEW("OLD_FOR_NEW", "以旧换新"),
    LIFE_HOUSE("LIFE_HOUSE", "生活馆"),
    LIFE_HALL_INDEX("LIFE_HALL_INDEX", "新生活馆"),
    APP_INDEX("APP_INDEX","APP首页"),
    ;

    /**
     * 活动类型
     */
    private String activityCode;

    /**
     * 活动描述
     */
    private String activityType;

    BannerTypeEnums(String activityCode, String activityType) {
        this.activityCode = activityCode;
        this.activityType = activityType;
    }

    /**
     * 获取活动类型
     *
     * @param activityCode
     * @return
     */
    public static String getActivityType(String activityCode) {
        BannerTypeEnums[] values = BannerTypeEnums.values();
        for (BannerTypeEnums value : values) {
            if(value.activityCode.equals(activityCode)) {
                return value.getActivityType();
            }
        }
        return null;
    }
}
